package com.keshi.openplatform.search.mq;


import com.keshi.openplatform.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

@Component
public class OpenApilLogListener {
    @Autowired
    private SearchService searchService;


    @StreamListener("openapiindexlog")
    public void onMessage(String data) {

        System.err.println("收到的数据是:" + data);
        try {
            searchService.add(data);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}
